<%@ page import="Pojo.User" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: TANGYU
  Date: 2024/5/15
  Time: 13:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表格</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f7f7f7;
            margin: 0;
            padding: 0;
        }

        h1 {
            text-align: center;
            margin-top: 20px;
            color: #333;
        }

        table {
            width: 80%;
            margin: 20px auto;
            border-collapse: collapse;
            background-color: #fff;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
        }

        th, td {
            border: 1px solid #ddd;
            padding: 10px;
            text-align: left;
        }

        th {
            background-color: #f2f2f2;
            font-weight: bold;
        }

        tr:nth-child(even) {
            background-color: #f9f9f9;
        }

        tr:hover {
            background-color: #f1f1f1;
        }

        .button-container {
            text-align: center;
            margin-top: 20px;
        }

        .button {
            padding: 10px 20px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            margin-right: 10px;
        }

        .button:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>
<h1>用户信息表</h1>

<table>
    <tr>
        <th>ID</th>
        <th>用户名</th>
        <th>密码</th>
        <th>备注信息</th>
        <th>兴趣爱好</th>
    </tr>
    <%
        List<User> userList = (List<User>) request.getAttribute("userList");
        for (User user : userList) {
            out.println("<tr>");
            out.println("<td>" + user.getId() + "</td>");
            out.println("<td>" + user.getUsername() + "</td>");
            out.println("<td>" + user.getPassword() + "</td>");
            out.println("<td>" + user.getInformation() + "</td>");
            out.println("<td>" + user.getHobby() + "</td>");
            out.println("</tr>");
        }
    %>
<%--    <c:forEach var="item" items="${resultList}">--%>
<%--        <tr>--%>
<%--            <td>${item.id}</td>--%>
<%--            <td>${item.username}</td>--%>
<%--            <td>${item.password}</td>--%>
<%--            <td>${item.information}</td>--%>
<%--            <td>${item.hobby}</td>--%>
<%--        </tr>--%>
<%--    </c:forEach>--%>

</table>

<%--<div class="button-container">--%>
<%--    <button class="button" onclick="">新增记录</button>--%>
<%--    <button class="button">查询记录</button>--%>
<%--</div>--%>
</body>
</html>
